import { uuid } from "../utils/Util";

export class BaseGraphic {
  constructor(options) {
    this.options = options;
    options.style = options.style || {} 
    options.attr = options.attr || {} 

    this._uuid = uuid();
    this.options.id = Cesium.defaultValue(options.id, this._uuid);
    this._name = options.name || options.attr.name;
    this._show = Cesium.defaultValue(options.show, true)
  }
  get uuid() {
    return this._uuid;
  }
  get id() {
    return this.options.id;
  }
  set id(id) {
    this.options.id = id;
  }

    /**
   *  矢量数据类型
   *
   * @type {String}
   * @readonly
   */
    get type() {
      return this._type
    }

   /**
   * 样式信息
   * @type {Object}
   */
   get style() {
    return this.options.style
  }
  set style(style) {
    this.options.style = Object.assign(this.options.style, style)
  }

  _onAdd(layer) {
    this._layer = layer;
    this._map = layer._map;
  }

  remove() {

  }
}